<? include ("../init.php") ?>
<? include ("../header.php") ?>
<? include ("../menu.php") ?>
<? include ("submenu.php") ?>

<div id = "body">

<h1><?_l('upload')?></h1>

<a href = "#" onclick = "upload()" class = "add"><img src = "<?=ADMIN?>/images/icon-add.png">&nbsp;&nbsp;&nbsp;<?_l('upload')?></a>

<div class = "page">
<?
  $count = $db->countOfAll('picture');
  $start = setpage($count);
?>
</div>

<div class = "clear"></div>

<table class ="list">
  <tr>
    <th scope="col" width = "35"><?_l('order')?></th>
    <th scope="col"><?_l('picture')?></th>
    <th scope="col"><?_l('url')?></th>
    <th scope="col" width = "50"><?_l('edit')?></th>
    <th scope="col" width = "50"><?_l('delete')?></th>
  </tr>
<?
  $sql = "SELECT * FROM picture ORDER By pid DESC LIMIT $start, ".PAGE;
  $rss = $db->query($sql);

  while ($line = $db->fetchNextObject($rss)){
    $start++;
?>
  <tr>
    <td><?=$start?></td>
    <td><a href = "<?=$line->url?>" target = "_blank"><?=makethumb($line->url,50) ?></a></td>
    <!-- <td><img src = "<?=$line->url?>"></td> -->
    <td><?=$line->url?></td>
    <td><a href = "edit.php?pid=<?=$line->pid?>&page=<?=$line->page?>" class = "btn"><?_l('edit')?></a></td>
    <td><a href = "del.php?pid=<?=$line->pid?>&page=<?=$line->page?>" class = "btn" onClick = "return confirmSubmit()"><?_l('delete')?></a></td>
  </tr>
<?
  }
?>
</table>

</div>

<? include "../footer.php" ?>